<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>DH-Blog管理系统</title>
		<link rel="stylesheet" type="text/css" href="../css/layui/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="../css/public.css" />
		<link rel="stylesheet" type="text/css" href="../css/animations.css" />
		<link rel="stylesheet" type="text/css" href="../css/edit.css"/>
	</head>

	<body class="layui-layout-body">
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header" style="color: #fff;">
				<a href="./">
					<div class="layui-logo" style="background-color: rgba(0,0,0,.05);">
						<h1>DH-Blog</h1>
					</div>
				</a>
				<!-- 头部区域（可配合layui已有的水平导航） -->
				<!-- 					    <ul class="layui-nav layui-layout-left">
	      <li class="layui-nav-item"><a href="">控制台</a></li>
	      <li class="layui-nav-item"><a href="">商品管理</a></li>
	      <li class="layui-nav-item"><a href="">用户</a></li>
	      <li class="layui-nav-item">
	        <a href="javascript:;">其它系统</a>
	        <dl class="layui-nav-child">
	          <dd><a href="">邮件管理</a></dd>
	          <dd><a href="">消息管理</a></dd>
	          <dd><a href="">授权管理</a></dd>
	        </dl>
	      </li>
	    </ul> -->
				<ul class="layui-nav layui-layout-left">
					<li class="layui-nav-item"><a href="javascript:turnItemBtn();" class="layui-icon item-btn">&#xe668;</a></li>
				</ul>
				<ul class="layui-nav layui-layout-right">
					<li class="layui-nav-item"><a href="">博客首页</a></li>
					<li class="layui-nav-item"><a href="">退出系统</a></li>
				</ul>
			</div>

			<div class="layui-side layui-bg-black" id="side">
				<div class="layui-side-scroll">
					<div class="head-img">
						<a href="javascript:;">
							<img src="http://t.cn/RCzsdCq" class="layui-img">
							<strong>Danyhug</strong>
						</a>
					</div>
					<hr class="layui-bg-gray">
					<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
					<ul class="layui-nav layui-nav-tree" lay-filter="test">
						<li class="layui-nav-item">
							<a href="./index.html"><i class="layui-icon layui-icon-console"></i>仪表盘</a>
						</li>
						<li class="layui-nav-item layui-this">
							<a href="./edit.html"><i class="layui-icon layui-icon-add-1"></i>博客发布</a>
							<!-- 	          <dl class="layui-nav-child">
		            <dd><a href="javascript:;">列表一</a></dd>
		            <dd><a href="javascript:;">列表二</a></dd>
		            <dd><a href="">超链接</a></dd>
		          </dl> -->
						</li>
						<li class="layui-nav-item"><a href="./blogsetting.html"><i class="layui-icon layui-icon-util"></i>博客管理</a></li>
						<li class="layui-nav-item"><a href="./usersetting.html"><i class="layui-icon layui-icon-user"></i>账户设置</a></li>
						<li class="layui-nav-item"><a href="./systemconfig.html"><i class="layui-icon layui-icon-set"></i>系统配置</a></li>
					</ul>
				</div>
			</div>

			<div class="layui-body" id="body">
				<!-- 内容主体区域 -->
				<div style="padding: 15px;position: relative;">
					<fieldset class="layui-elem-field">
						<legend>博客发布</legend>
						<div class="layui-field-box">

							<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="margin: 5px 0px;">
								<ul class="layui-tab-title">
									<li class="layui-this">添加标签</li>
									<li>选择分类</li>
								</ul>
								<div class="layui-tab-content">
									<div class="layui-tab-item layui-show">
										<div class="layui-btn-container">
											<button type="button" class="layui-btn layui-btn-normal">Css</button>
											<button type="button" class="layui-btn layui-btn-normal">Golang</button>
											<button type="button" class="layui-btn layui-btn-normal">脱发</button>
										</div>
									</div>
									<div class="layui-tab-item">
										<div class="layui-btn-container">
											<button type="button" class="layui-btn layui-btn-warm">首页</button>
											<button type="button" class="layui-btn layui-btn-warm">光影</button>
											<button type="button" class="layui-btn layui-btn-warm">日记</button>
										</div>
									</div>
								</div>
							</div>

							<div id="editor1"></div>
							<hr class="layui-bg-green">
							<div style="padding: 5px 0; color: #ccc; font-size: 16px;">当前标签为：<span>Css</span>, 当前分类为：<span>日记</span></div>
							<hr class="layui-bg-blue">
							<div id="editor2" class="layui-bg-gray">
								<blockquote id="temptext">在下面输入内容 <small class="layui-bg-red">点我消除此提示</small></blockquote>
							</div>

							<div class="layui-btn-group" style="margin: 40px 20px; float: right;">
								<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-lg" onclick="sendContent()">发布</button>
								<script>
									function sendContent() {
										var content = editor.txt.html();
										alert(content);
									}
								</script>
								<button class="layui-btn layui-btn-radius layui-btn-lg" onclick="addContent()">默认</button>
								<script>
									function addContent() {
										var tempHtml =
											'<h1 style="text-align: center;">标题一</h1><h2><img src="https://www.baidu.com/img/dong_30a61f45c8d4634ca14da8829046271f.gif" style="font-size: 14px; max-width: 100%;"><br></h2><h2>小标题一：</h2><p>正文：</p><h2>小标题二：</h2><p>正文：</p><h2>小标题三：</h2><p>正文：</p><pre><code>插入代码&lt;test&gt;&lt;/test&gt;</code></pre><blockquote>引用于......</blockquote><p><a href="127.0.0.1" target="_blank">测试链接</a>😊</p>';
										editor.txt.clear();
										editor.txt.html(tempHtml);
									}
								</script>
								<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-lg" onclick="javascript:editor.txt.clear();">清空</button>
							</div>

						</div>
				</div>
				</fieldset>
				<!-- 主体内容结束 -->
			</div>

			<script type="text/javascript" src="../js/editor/wangEditor.min.js"></script>
			<script type="text/javascript">
				var E = window.wangEditor;
				var editor = new E('#editor1', '#editor2');
				// 或者 var editor = new E( document.getElementById('editor') )
				editor.create();

				document.getElementById("temptext").onclick = function() {
					editor.txt.clear();
				};
			</script>

			<div class="layui-footer" id="footer">
				<!-- 底部固定区域 -->
				© BH-Blog
			</div>
		</div>
		<script src="../css/layui/layui.js"></script>
		<script src="../js/public.js"></script>
		<script>
			//JavaScript代码区域
			layui.use('element', function() {
				var element = layui.element;

			});
		</script>
	</body>
</html>
